/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Persistence;

/**
 *
 * @author kenneth
 */
public class PersistenceController {
    private DatabaseConnection dbConn;
    private UserMapper userMapper;
    private static PersistenceController pc;
    
    private PersistenceController() {
        dbConn = new DatabaseConnection();
        userMapper = new UserMapper(dbConn);
    }
    
    public static PersistenceController getController() {
        if(pc == null) {
            pc = new PersistenceController();
        }
        return pc;
    }
    
    public boolean authenticateUser(String email, String paswoord) {
        return userMapper.authenticateUser(email, paswoord);
    }
    
    public int getIdByEmail(String email) {
        return userMapper.getIdByEmail(email);
    }
}
